package com.example.mapper.other;


import com.example.model.entity.other.ChatRole;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ChatRoleMapper {

    /**
      * 新增
    */
    int insert(ChatRole chatRole);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(ChatRole chatRole);

    /**
      * 根据ID查询
    */
    ChatRole selectById(Integer id);

    /**
      * 查询所有
    */
    List<ChatRole> selectAll(ChatRole chatRole);
    @Select("select * from chatrole where chatrole.name = #{name} and chatrole.role = #{role}")
    ChatRole selectByNameAndRole(String name, String role);
    @Select("select * from chatrole where chatrole.doctorId=#{id}")
    ChatRole selectByDoctorId(Integer id);
    @Select("select * from chatrole where chatrole.usersId=#{id}")
    ChatRole selectByUserId(Integer id);
    @Select("select * from chatrole where chatrole.businessId=#{id}")
    ChatRole selectByBusinessId(Integer id);
}
